package jeconbond.experiment.natural.prodpossibfrontier.process;

import jeconbond.economic.natural.agent.service.ObserveResourceValueAgent;
import jeconbond.economic.systems.natural.INaturalResourceRedestributionSystem;
import jeconbond.experiment.natural.prodpossibfrontier.ConneryExperimentSettings;
import jeconbond.experiment.process.IJEBExperimentContext;
import jeconbond.experiment.process.BaseJEBExperimentContext;
import laboratoryQ.experiment.process.IExperimentContextFactory;
import laboratoryQ.experiment.settings.IExperimentSettings;

public class ConneryExperimentContext extends BaseJEBExperimentContext implements IConneryExperimentContext, IExperimentContextFactory {
	public static final IExperimentContextFactory FACTORY_INSTANCE = new ConneryExperimentContext();
	
	private ObserveResourceValueAgent observeResourceValueAgent;

	private ConneryExperimentContext() {}

	public ConneryExperimentContext(ConneryExperimentSettings experimentSettings) {
		super(experimentSettings);
		observeResourceValueAgent = new ObserveResourceValueAgent(
				this,
				experimentSettings.tankResource,
				experimentSettings.traktorResource
		);
		addServiceAgent(observeResourceValueAgent);
	}

	@Override
	public ConneryExperimentSettings getExperimentSettings() {
		return (ConneryExperimentSettings)super.getExperimentSettings();
	}

	@Override
	public ObserveResourceValueAgent getObserveResourceValueAgent() {
		return observeResourceValueAgent;
	}

	@Override
	public INaturalResourceRedestributionSystem getRRS() {
		return (INaturalResourceRedestributionSystem) super.getRRS();
	}

	@Override
	public IJEBExperimentContext newContext(IExperimentSettings settings) {
		return new ConneryExperimentContext((ConneryExperimentSettings) settings);
	}
}
